Q3Quaternion_Multiply
You can use theQ3Quaternion_Multiply
function to multiply two quaternions.
TQ3Quaternion *Q3Quaternion_Multiply ( const TQ3Quaternion *q1, const TQ3Quaternion *q2, TQ3Quaternion *result);
q1
- A quaternion.
q2
- A quaternion.
result
- On exit, the product of
q1
andq2
.DESCRIPTION
TheQ3Quaternion_Multiply
function returns, as its function result and in theresult
parameter, the product of the two quaternionsq1
andq2
.If you want to rotate an object by the quaternion
qFirst
and then rotate the resulting object by the quaternionqSecond
, you can accomplish both rotations at once by applying the quaternionqResult
that is obtained as follows:
Q3Quaternion_Multiply(qSecond, qFirst, qResult);Note the order of the quaternion multiplicands.